package com.ITArmy.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class CheckTel {
    public boolean isPhone(String phone) {
        String regex = "\t0?(13|14|15|17|18)[0-9]{9}";
        if (phone.length() != 11) {
            return false;
        } else {
            Pattern p = Pattern.compile(regex);
            Matcher m = p.matcher(phone);
            boolean isMatch = m.matches();
            if (isMatch) {
                return true;
            } else {
                return false;

            }
        }
    }

}
